package com.iwop.moto.service.impl;

import com.iwop.moto.model.FPrizeUser;
import com.iwop.moto.model.SuperRecordModel;
import com.iwop.moto.service.BaseService;
import com.iwop.moto.service.FPrizeUserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 52HzBobo on 2016/11/16.
 */
@Service
public class FPrizeUserServiceImpl extends BaseService implements FPrizeUserService{


    public void insert(FPrizeUser fPrizeUser){
        getSqlSession().insert("FPrizeUserMapper.insert",fPrizeUser);
    }

    public void update(FPrizeUser fPrizeUser){
        getSqlSession().update("FPrizeUserMapper.update",fPrizeUser);
    }

    public Long findPrizeCountByParams(FPrizeUser fPrizeUser){
        Long countNum = getSqlSession().selectOne("FPrizeUserMapper.findPrizeCountByParams", fPrizeUser);
        return countNum;
    }

    @Override
    public List<SuperRecordModel> findPrizeSuccess() {
        List<SuperRecordModel> objects = getSqlSession().selectList("FPrizeUserMapper.findPrizeSuccess");
        return objects;
    }

    @Override
    public SuperRecordModel findPrizeCode(SuperRecordModel srModel) {
        SuperRecordModel objects = getSqlSession().selectOne("FPrizeUserMapper.findPrizeCode",srModel);
        return objects;
    }

    @Override
    public FPrizeUser findPrizeByOpenId(String openid) {
        FPrizeUser objects = getSqlSession().selectOne("FPrizeUserMapper.findPrizeByOpenId",openid);
        return objects;
    }

    @Override
    public List<SuperRecordModel> findPrizeByPrizeFlag(SuperRecordModel superRecordModel) {
        return getSqlSession().selectList("FPrizeUserMapper.findPrizeByPrizeFlag",superRecordModel);
    }
}
